3.10.28 \(\int \frac {1}{(a+i a \tan (e+f x)) (c-i c \tan (e+f x))} \, dx\) [928]

Optimal. Leaf size=37 \[ \frac {x}{2 a c}+\frac {\cos (e+f x) \sin (e+f x)}{2 a c f} \]

[Out]

1/2*x/a/c+1/2*cos(f*x+e)*sin(f*x+e)/a/c/f

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 37, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.097, Rules used = {3603, 2715, 8} \begin {gather*} \frac {\sin (e+f x) \cos (e+f x)}{2 a c f}+\frac {x}{2 a c} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[1/((a + I*a*Tan[e + f*x])*(c - I*c*Tan[e + f*x])),x]

[Out]

x/(2*a*c) + (Cos[e + f*x]*Sin[e + f*x])/(2*a*c*f)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2715

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Sin[c + d*x])^(n - 1)/(d*n))
, x] + Dist[b^2*((n - 1)/n), Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integ
erQ[2*n]

Rule 3603

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Di
st[a^m*c^m, Int[Sec[e + f*x]^(2*m)*(c + d*Tan[e + f*x])^(n - m), x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] &&
EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0] && IntegerQ[m] &&  !(IGtQ[n, 0] && (LtQ[m, 0] || GtQ[m, n]))

Rubi steps

\begin {align*} \int \frac {1}{(a+i a \tan (e+f x)) (c-i c \tan (e+f x))} \, dx &=\frac {\int \cos ^2(e+f x) \, dx}{a c}\\ &=\frac {\cos (e+f x) \sin (e+f x)}{2 a c f}+\frac {\int 1 \, dx}{2 a c}\\ &=\frac {x}{2 a c}+\frac {\cos (e+f x) \sin (e+f x)}{2 a c f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 29, normalized size = 0.78 \begin {gather*} \frac {2 (e+f x)+\sin (2 (e+f x))}{4 a c f} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[1/((a + I*a*Tan[e + f*x])*(c - I*c*Tan[e + f*x])),x]

[Out]

(2*(e + f*x) + Sin[2*(e + f*x)])/(4*a*c*f)

________________________________________________________________________________________

Maple [C] Result contains complex when optimal does not.
time = 0.13, size = 64, normalized size = 1.73

method result size
risch \(\frac {x}{2 a c}+\frac {\sin \left (2 f x +2 e \right )}{4 a c f}\) \(31\)
norman \(\frac {\frac {x}{2 a c}+\frac {\tan \left (f x +e \right )}{2 a c f}+\frac {x \left (\tan ^{2}\left (f x +e \right )\right )}{2 a c}}{1+\tan ^{2}\left (f x +e \right )}\) \(58\)
derivativedivides \(\frac {\frac {i \ln \left (\tan \left (f x +e \right )+i\right )}{4}+\frac {1}{4 \tan \left (f x +e \right )+4 i}-\frac {i \ln \left (\tan \left (f x +e \right )-i\right )}{4}+\frac {1}{4 \tan \left (f x +e \right )-4 i}}{f a c}\) \(64\)
default \(\frac {\frac {i \ln \left (\tan \left (f x +e \right )+i\right )}{4}+\frac {1}{4 \tan \left (f x +e \right )+4 i}-\frac {i \ln \left (\tan \left (f x +e \right )-i\right )}{4}+\frac {1}{4 \tan \left (f x +e \right )-4 i}}{f a c}\) \(64\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(a+I*a*tan(f*x+e))/(c-I*c*tan(f*x+e)),x,method=_RETURNVERBOSE)

[Out]

1/f/a/c*(1/4*I*ln(tan(f*x+e)+I)+1/4/(tan(f*x+e)+I)-1/4*I*ln(tan(f*x+e)-I)+1/4/(tan(f*x+e)-I))

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+I*a*tan(f*x+e))/(c-I*c*tan(f*x+e)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: Error executing code in Maxima: expt: undefined: 0 to a negative e
xponent.

________________________________________________________________________________________

Fricas [C] Result contains complex when optimal does not.
time = 1.42, size = 49, normalized size = 1.32 \begin {gather*} \frac {{\left (4 \, f x e^{\left (2 i \, f x + 2 i \, e\right )} - i \, e^{\left (4 i \, f x + 4 i \, e\right )} + i\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{8 \, a c f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+I*a*tan(f*x+e))/(c-I*c*tan(f*x+e)),x, algorithm="fricas")

[Out]

1/8*(4*f*x*e^(2*I*f*x + 2*I*e) - I*e^(4*I*f*x + 4*I*e) + I)*e^(-2*I*f*x - 2*I*e)/(a*c*f)

________________________________________________________________________________________

Sympy [A]
time = 0.14, size = 117, normalized size = 3.16 \begin {gather*} \begin {cases} \frac {\left (- 8 i a c f e^{4 i e} e^{2 i f x} + 8 i a c f e^{- 2 i f x}\right ) e^{- 2 i e}}{64 a^{2} c^{2} f^{2}} & \text {for}\: a^{2} c^{2} f^{2} e^{2 i e} \neq 0 \\x \left (\frac {\left (e^{4 i e} + 2 e^{2 i e} + 1\right ) e^{- 2 i e}}{4 a c} - \frac {1}{2 a c}\right ) & \text {otherwise} \end {cases} + \frac {x}{2 a c} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+I*a*tan(f*x+e))/(c-I*c*tan(f*x+e)),x)

[Out]

Piecewise(((-8*I*a*c*f*exp(4*I*e)*exp(2*I*f*x) + 8*I*a*c*f*exp(-2*I*f*x))*exp(-2*I*e)/(64*a**2*c**2*f**2), Ne(
a**2*c**2*f**2*exp(2*I*e), 0)), (x*((exp(4*I*e) + 2*exp(2*I*e) + 1)*exp(-2*I*e)/(4*a*c) - 1/(2*a*c)), True)) +
 x/(2*a*c)

________________________________________________________________________________________

Giac [A]
time = 0.48, size = 46, normalized size = 1.24 \begin {gather*} \frac {\frac {f x + e}{a c} + \frac {\tan \left (f x + e\right )}{{\left (\tan \left (f x + e\right )^{2} + 1\right )} a c}}{2 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+I*a*tan(f*x+e))/(c-I*c*tan(f*x+e)),x, algorithm="giac")

[Out]

1/2*((f*x + e)/(a*c) + tan(f*x + e)/((tan(f*x + e)^2 + 1)*a*c))/f

________________________________________________________________________________________

Mupad [B]
time = 4.59, size = 32, normalized size = 0.86 \begin {gather*} \frac {\frac {\sin \left (2\,e+2\,f\,x\right )}{4\,a\,c}+\frac {f\,x}{2\,a\,c}}{f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/((a + a*tan(e + f*x)*1i)*(c - c*tan(e + f*x)*1i)),x)

[Out]

(sin(2*e + 2*f*x)/(4*a*c) + (f*x)/(2*a*c))/f

________________________________________________________________________________________